package com.msite
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.boot.context.web.SpringBootServletInitializer
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
/**
 * Created by tpeng on 2015/10/16.
 */
@Configuration
//@Configurable  //注解告诉 spring 该类定义了 application context 的 bean 的一些配置。
@ComponentScan  //注解告诉 Spring 遍历带有 @Component 注解的类。
@EnableAutoConfiguration  //注解会基于你的类加载路径的内容切换合理的默认行为。
class MySiteApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(MySiteApplication.class, args)
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(MySiteApplication.class);
    }

}
